package com.iflytek.document;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.List;

@Data
@Document(indexName = "user_info")
public class UserDocument {
    @Id
    private Long id;

    @Field(name = "username", type = FieldType.Text)
    @ApiModelProperty(value = "用户名")
    private String username;

    @Field(name = "password", type = FieldType.Text)
    @ApiModelProperty(value = "密码")
    private String password;

    @Field(name = "nickName", type = FieldType.Text)
    @ApiModelProperty(value = "昵称")
    private String nickName;

    @Field(name = "email", type = FieldType.Text)
    @ApiModelProperty(value = "邮箱")
    private String email;

    @Field(name = "phone", type = FieldType.Text)
    @ApiModelProperty(value = "手机号")
    private String phone;

    @Field(name = "avatar", type = FieldType.Text)
    @ApiModelProperty(value = "头像")
    private String avatar;

    @Field(name = "role", type = FieldType.Long)
    @ApiModelProperty(value = "角色")
    private List<Long> role;

    @Field(name = "address", type = FieldType.Text)
    @ApiModelProperty(value = "地址")
    private String address;

    @Field(name = "age", type = FieldType.Integer)
    @ApiModelProperty(value = "年龄", example = "1")
    private Integer age;

    @Field(name = "account", type = FieldType.Double)
    @ApiModelProperty(value = "账户余额")
    private BigDecimal account;
}
